<?php

namespace app\admin\model;

use think\Model;


class Qjsosuo extends Model
{

    

    

    // 表名
    protected $name = 'qjsosuo';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'integer';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = false;
    protected $deleteTime = false;

    // 追加属性
    protected $append = [
        'stype_text'
    ];
    

    
    public function getStypeList()
    {
        return ['1' => __('Stype 1'), '2' => __('Stype 2'), '3' => __('Stype 3'), '4' => __('Stype 4')];
    }


    public function getStypeTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['stype']) ? $data['stype'] : '');
        $list = $this->getStypeList();
        return isset($list[$value]) ? $list[$value] : '';
    }




}
